package main

import (
	_ "chuanyou1/routers"
	"fmt"

	"github.com/beego/beego/v2/client/orm"
	beego "github.com/beego/beego/v2/server/web"
	_ "github.com/go-sql-driver/mysql"
)

func init() {
	fmt.Println("版权信息.学号：220320204005")
}

func main() {
	sqlConn, err := beego.AppConfig.String("sqlconn")
	if err != nil {

	}
	orm.RegisterDataBase("default", "mysql", sqlConn)
	orm.Debug = true

	if beego.BConfig.RunMode == "dev" {
		beego.BConfig.WebConfig.DirectoryIndex = true
		beego.BConfig.WebConfig.StaticDir["/swagger"] = "swagger"
	}

	beego.SetStaticPath("/", "views")
	beego.Run()
}
